#ifndef define_game_h
#define define_game_h

#import "head.h"

@class SpriteGameEnemy;

/*mission type
*/
#define MISSION_TYPE_NORMAL 0
#define MISSION_TYPE_BOSS 1

/*mission state
*/
#define MISSION_STATE_INVALID -1
#define MISSION_STATE_SCENE_PREVIEW 0
#define MISSION_STATE_SCENE_PERVIEW_OVER 1
#define MISSION_STATE_LAYER_OBJECT_READY 2
#define MISSION_STATE_TUTORAIL_WAIT 3
#define MISSION_STATE_PLAY 4
#define MISSION_STATE_ENEMY_ALL_DIE 5
#define MISSION_STATE_WAIT_BIRDGE_SUCCESS_ANI 6
#define MISSION_STATE_WIN_ALL_ENEMY_KILL 7
#define MISSION_STATE_WIN 8
#define MISSION_STATE_FAIL 9
#define MISSION_STATE_TIME_UP 10

/*mission action time
*/
#define MISSION_START_PLAY_TIME 0.3 /*游戏开始界面浮现得表演时间*/

/*mission enemy path element type
*/
#define MISSION_ENEMY_PATH_ELEMENT_AREA_INDEX 0
#define MISSION_ENEMY_PATH_ELEMENT_POINT 1

/*BACKGROUND
*/
#define BACKGROUND_TYPE_0 0
#define BACKGROUND_TYPE_1 1
#define BACKGROUND_TYPE_2 2
#define BACKGROUND_TYPE_3 3

/*AREA
*/
#define OFF_SCRREN_AREA_W 100
#define OFF_SCRREN_AREA_H 100
#define SPLITE_SIZE 50

/*bow type
*/
#define BOW_TYPE_0 0
#define BOW_TYPE_1 1
#define BOW_TYPE_2 2
#define BOW_TYPE_3 3
#define BOW_TYPE_4 4
#define BOW_TYPE_COUNT 5

/*arrow type
*/
#define ARROW_TYPE_0 0
#define ARROW_TYPE_1 1
#define ARROW_TYPE_2 2
#define ARROW_TYPE_3 3
#define ARROW_TYPE_4 4
#define ARROW_TYPE_COUNT 5

/*enemy type
*/
#define ENEMY_TYPE_0 0
#define ENEMY_TYPE_1 1
#define ENEMY_TYPE_2 2
#define ENEMY_TYPE_3 3
#define ENEMY_TYPE_4 4
#define ENEMY_TYPE_5 5
#define ENEMY_TYPE_6 6
#define ENEMY_TYPE_7 7
#define ENEMY_TYPE_COUNT 8

#define ENEMY_TYPE_BOSS_1 8
#define ENEMY_TYPE_BOSS_2 9
#define ENEMY_TYPE_BOSS_3 10

/*enemy ai type
*/
#define ENEMY_AI_TYPE_0 0 /*按固定点或者区域运动*/
#define ENEMY_AI_TYPE_1 1 /*到固定点，投弹，然后下一点*/
#define ENEMY_AI_TYPE_2 2 /*自由*/
#define ENEMY_AI_TYPE_3 3 /*蜘蛛boss的奴隶*/

/*boss 3
*/
#define BOSS_3_QTE_EYE_COUNT 5

/*enemy animation
*/
#define ENEMY_ANI_MOVE 0
#define ENEMY_ANI_ATTACK 1
#define ENEMY_ANI_DIE 2

#define ENEMY_ANI_BOSS_3_APPEAR 3
#define ENEMY_ANI_BOSS_3_EYE_OPEN 4
#define ENEMY_ANI_BOSS_3_EYE_CLOSE 5

/*bomb type
*/
#define BOMB_TYPE_0 0
#define BOMB_TYPE_1 1
#define BOMB_TYPE_2 2
#define BOMB_TYPE_3 3
#define BOMB_TYPE_4 4
#define BOMB_TYPE_5 5
#define BOMB_TYPE_6 6
#define BOMB_TYPE_COUNT 7

/*swirl type
*/
#define SWIRL_TYPE_0 0
#define SWIRL_TYPE_COUNT 1

/*heart animation
*/
#define HEART_ANI_FLY 0
#define HEART_ANI_DIE 1

/*data structure
*/
typedef struct SMissionEnemyPathElement_
{
	int path_type;
	int area_index;
	CGPoint point;
}
SMissionEnemyPathElement;

typedef struct SMissionEnemy_
{
	bool flag_is_loaded;
	int enemy_type;
	int ai_type;
	float born_delay;
	SMissionEnemyPathElement born_area;
	std::vector<SMissionEnemyPathElement> move_path_table;
	float move_speed;
	float move_speed_variance;
	float stand_time;
	int drop_heart_point;
	SpriteGameEnemy *object;
}
SMissionEnemy;

typedef struct SBaseDataBow_
{
	int anchor_point_to_bottom;
	CGPoint left_point;
	CGPoint right_point;
	int arrow_type;
	char image_path[STRING_BUF_SIZE];
	CGSize image_size;
	UIAnimationObject ani_normal;
	UIAnimationObject ani_release;
}
SBaseDataBow;

typedef struct SBaseDataArrow_
{
	int type;
	int level_max;
	std::vector<float> level_up_hold_time_table;
	std::vector<int> attack_point_table;
	std::vector<int> perforation_table;
	float cool_down_time;
	std::vector<CGPoint> box2d_collision_point_table;
	int max_drag_distance;
	std::vector<std::string> image_path_table;
	CGSize image_size;
	char particle_path[STRING_BUF_SIZE];
	UIAnimationObject ani_normal;
	UIAnimationObject ani_invalid;
	UIAnimationObject ani_explode;
}
SBaseDataArrow;

typedef struct SBaseDataEnemy_
{
	int life_point;
	int bomb_type;
	int bomb_offset;
	float bomb_delay;
	std::vector<CGPoint> box2d_collision_point_table_body;
	std::vector<CGPoint> box2d_collision_point_table_armor;
	CGPoint life_bar_position;
	char default_image_path[STRING_BUF_SIZE];
	UIAnimationObject ani_move;
	UIAnimationObject ani_attack;
	UIAnimationObject ani_die;
	UIAnimationObject ani_shock_wave;
	UIAnimationObject ani_cover;
	UIAnimationObject ani_mouth;
	UIAnimationObject ani_mosquito;
}
SBaseDataEnemy;

typedef struct SBaseDataBoss1_
{
	int life_point;
	int bomb_type;
	int bomb_offset;
	std::vector<CGPoint> box2d_collision_point_table_head;
	std::vector<CGPoint> box2d_collision_point_table_body;
	CGPoint life_bar_position;
	char default_image_path[STRING_BUF_SIZE];
	UIAnimationObject ani_move;
	UIAnimationObject ani_attack;

	int tail_life_point;
	char tail_image_path[STRING_BUF_SIZE];
	std::vector<CGPoint> box2d_collision_point_table_tail_left;
	std::vector<CGPoint> box2d_collision_point_table_tail_right;
}
SBaseDataBoss1;

typedef struct SBaseDataBoss2_
{
	int life_point;
	int bomb_type;
	int bomb_offset;
	std::vector<CGPoint> box2d_collision_point_table_body;
	CGPoint life_bar_position;
	char default_image_path[STRING_BUF_SIZE];
	UIAnimationObject ani_move;
	UIAnimationObject ani_attack;
	UIAnimationObject ani_die;
	std::vector<CGPoint> box2d_collision_point_table_skull;
	char skull_image_path[128];
	char weak_point_image_path[STRING_BUF_SIZE];
}
SBaseDataBoss2;

typedef struct SBaseDataBoss3_
{
	int life_point;
	int bomb_type;
	int bomb_offset;
	std::vector<CGPoint> box2d_collision_point_table_head;
	std::vector<CGPoint> box2d_collision_point_table_body;
	std::vector<CGPoint> box2d_collision_point_table_ass;
	CGPoint life_bar_position;
	char default_image_path[256];
	UIAnimationObject ani_appear;
	UIAnimationObject ani_move;
	UIAnimationObject ani_attack;
	UIAnimationObject ani_eye_open;
	UIAnimationObject ani_eye_close;

	std::vector<CGPoint> child_eye_position_table;
	CGSize child_eye_size;
	UIAnimationObject ani_child_eye_open;
	UIAnimationObject ani_child_eye_close;
}
SBaseDataBoss3;

typedef struct SBaseDataBomb_
{
	int attack_point;
	bool can_be_destroy;
	std::vector<CGPoint> box2d_collision_point_table;
	char image_path[STRING_BUF_SIZE];
	UIAnimationObject ani_fly;
	char particle_effect_explode[STRING_BUF_SIZE];
}
SBaseDataBomb;

typedef struct SBaseDataSwirl_
{
	float life_cycle;
	float eat_heart_time;
	char image_path[128];
	UIAnimationObject ani;
}
SBaseDataSwirl;

typedef struct SBaseDataHeart_
{
	float life_cycle;
	std::vector<CGPoint> box2d_collision_point_table;
	char default_image_path[STRING_BUF_SIZE];
	UIAnimationObject ani_fly;
	UIAnimationObject ani_die;
	char dark_image_path[128];
	UIAnimationObject ani_dark_fly;
	UIAnimationObject ani_dark_die;
}
SBaseDataHeart;

#endif
